package com.cqupt.pojo;

import java.util.ArrayList;
import java.util.List;

public class AuthorityTemplateExample {
    protected String orderByClause;
    protected boolean distinct;
    protected List<Criteria> oredCriteria;
    /**
     * 创建一个oredCriteria
     */
    public AuthorityTemplateExample() {
        oredCriteria = new ArrayList<>();
    }
    /**
     * 建立排序
     * @param orderByClause
     */

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }
    /**
     * 获取排序
     * @return 返回一个排序
     */

    public String getOrderByClause() {
        return orderByClause;
    }
    /**
     * 设置distinct的值
     * @param distinct
     */

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    /**
     * 返回 distinct
     * @return
     */
    public boolean isDistinct() {
        return distinct;
    }
    /**
     *
     * @return 返回一个oredCriteria列表
     */
    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }
    /**
     * 增加criterial
     * @param criteria
     */
    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }
    /**
     *
     * @return 返回增加后的criteria
     */
    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }
    /**
     * 创建Criteria并添加到表中
     * @return 返回oredCriteria表
     */
    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }
    /**
     * 创建Criteria
     * @return
     */
    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }
    /**
     * 清除oredCriteria
     */
    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    /**
     * 生成Criteria
     */
    protected abstract static class GeneratedCriteria {
//        创建一个criteria表
        protected List<Criterion> criteria;

        /**
         * 生成一个criteria
         */
        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<>();
        }
        /**
         * 判断criteria是否为空
         * @return 返回 true 或 false
         */
        public boolean isValid() {
            return criteria.size() > 0;
        }
        /**
         * 获取所有的criteria
         * @return
         */
        public List<Criterion> getAllCriteria() {
            return criteria;
        }
        /**
         * 获取Criteria
         * @return
         */
        public List<Criterion> getCriteria() {
            return criteria;
        }
        /**
         * 添加Criterion
         * @param condition
         */
        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }
        /**
         *
         * @param condition 条件
         * @param value 值
         * @param property 属性
         */
        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }
        /**
         * 添加criterion
         * @param condition 条件
         * @param value1 值1
         * @param value2 值2
         * @param property 属性
         */
        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }
        /**
         * 添加一个说明template_name为空
         * @return
         */
        public Criteria andTemplateNameIsNull() {
            addCriterion("template_name is null");
            return (Criteria) this;
        }
        /**
         * 添加template_name不为空
         * @return
         */
        public Criteria andTemplateNameIsNotNull() {
            addCriterion("template_name is not null");
            return (Criteria) this;
        }
        /**
         * 添加template_name
         * @param value
         * @return
         */
        public Criteria andTemplateNameEqualTo(String value) {
            addCriterion("template_name =", value, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加templatename不相等的
         * @param value
         * @return
         */
        public Criteria andTemplateNameNotEqualTo(String value) {
            addCriterion("template_name <>", value, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加template_name 大于的
         * @param value
         * @return
         */
        public Criteria andTemplateNameGreaterThan(String value) {
            addCriterion("template_name >", value, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加 template_name 大于等于的值
         * @param value
         * @return
         */
        public Criteria andTemplateNameGreaterThanOrEqualTo(String value) {
            addCriterion("template_name >=", value, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加template_name小于的值
         * @param value
         * @return
         */
        public Criteria andTemplateNameLessThan(String value) {
            addCriterion("template_name <", value, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加template_name小于或等于的值
         * @param value
         * @return
         */
        public Criteria andTemplateNameLessThanOrEqualTo(String value) {
            addCriterion("template_name <=", value, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加类似template_name的值
         * @param value
         * @return
         */
        public Criteria andTemplateNameLike(String value) {
            addCriterion("template_name like", value, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加template_name不类似的值
         * @param value
         * @return
         */
        public Criteria andTemplateNameNotLike(String value) {
            addCriterion("template_name not like", value, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加template_name in 的值
         * @param values
         * @return
         */
        public Criteria andTemplateNameIn(List<String> values) {
            addCriterion("template_name in", values, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加template_name 不在的值
         * @param values
         * @return
         */
        public Criteria andTemplateNameNotIn(List<String> values) {
            addCriterion("template_name not in", values, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加template between的值
         * @param value1
         * @param value2
         * @return
         */
        public Criteria andTemplateNameBetween(String value1, String value2) {
            addCriterion("template_name between", value1, value2, "templateName");
            return (Criteria) this;
        }
        /**
         * 添加template_name not between的值
         * @param value1
         * @param value2
         * @return
         */
        public Criteria andTemplateNameNotBetween(String value1, String value2) {
            addCriterion("template_name not between", value1, value2, "templateName");
            return (Criteria) this;
        }
    }

    /**
     * 继承GeneratedCriteria
     */
    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    /**
     * 创建一个Criterion类
     */
    public static class Criterion {
        private String condition;
        private Object value;
        private Object secondValue;
        private boolean noValue;
        private boolean singleValue;
        private boolean betweenValue;
        private boolean listValue;
        private String typeHandler;

        /**
         * 获取condition
         * @return
         */
        public String getCondition() {
            return condition;
        }
        /**
         * 获取value
         * @return
         */
        public Object getValue() {
            return value;
        }
        /**
         * 获取第二个value值
         * @return
         */
        public Object getSecondValue() {
            return secondValue;
        }
        /**
         * 判断value是否为空
         * @return
         */
        public boolean isNoValue() {
            return noValue;
        }
        /**
         * 判断value是否是单个值
         * @return
         */
        public boolean isSingleValue() {
            return singleValue;
        }
        /**
         * 判断value是否处于between中
         * @return
         */
        public boolean isBetweenValue() {
            return betweenValue;
        }
        /**
         * 判断value是否为列表
         * @return
         */
        public boolean isListValue() {
            return listValue;
        }
        /**
         * 获取handler的类型
         * @return
         */
        public String getTypeHandler() {
            return typeHandler;
        }
        /**
         * criterion构造方法，添加condition属性
         * @param condition
         */
        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }
        /**
         * 增加value和typeHandler属性
         * @param condition
         * @param value
         * @param typeHandler
         */
        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        /**
         * 将condition和value传入
         * @param condition
         * @param value
         */
        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }
        /**
         * 继承后添加属性
         * @param condition
         * @param value
         * @param secondValue
         * @param typeHandler
         */
        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }
        /**
         * 将属性值 传入
         * @param condition
         * @param value
         * @param secondValue
         */
        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}